Matthew S. Stoyer's family called the police when he left his home on Kramer Mill Road at 5:43 a.m., and told dispatchers they believed he was under the influence of drugs and in an agitated state, East Cocalico police said.
About an hour later, an East Cocalico officer was near North Reamstown Road and heard a gunshot from a nearby home, authorities said.
That's when officers found Stoyer in a nearby home -- which was not occupied -- and found several firearms inside, authorities said.
Stoyer admitted breaking into the home because he thought people were chasing him, East Cocalico police said.
He said he fired two handgun rounds inside at people who he thought were chasing him, and in the direction of the police car to get the officers' attention, authorities said.
"There was no evidence that anyone else was chasing Stoyer or in the home," police said.
"There is no evidence that there is or was any danger to the public."
Stoyer was charged with burglary, criminal trespass and recklessly endangering another person.
He was transported to Central Arraignment.
East Cocalico Township Police are asking anyone who may have heard gunshots or witnessed the event to contact Detective Van Ausdal at 717 336 1725.
Click here to follow Daily Voice York and receive free news updates.